package com.atguigu.spring.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class Demo05ControllerHeaderCookie {

    @ResponseBody
    @RequestMapping("/receive/header/cookie")
    public String receiveHeader(
            @RequestHeader("Content-Type") String header,
            @CookieValue("JSESSIONID") String cookie) {
        System.out.println("header = " + header);
        System.out.println("cookie = " + cookie);
        return "ok";
    }

}
